package grouplife::Schema::Result::Category;

# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

use strict;
use warnings;

use Moose;
use MooseX::NonMoose;
use namespace::autoclean;
extends 'DBIx::Class::Core';

__PACKAGE__->load_components(qw( TimeStamp Core ));
=head1 NAME

grouplife::Schema::Result::Category

=cut

__PACKAGE__->table("category");

=head1 ACCESSORS

=head2 id

  data_type: 'integer'
  is_auto_increment: 1
  is_nullable: 0

=head2 name

  data_type: 'text'
  is_nullable: 1

=head2 cid

  data_type: 'integer'
  is_nullable: 1

=head2 created

  data_type: 'timestamp'
  datetime_undef_if_invalid: 1
  default_value: current_timestamp
  is_nullable: 0

=head2 updated

  data_type: 'timestamp'
  datetime_undef_if_invalid: 1
  default_value: current_timestamp
  is_nullable: 0

=cut

__PACKAGE__->add_columns(
		"id",
		{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
		"name",
		{ data_type => "text", is_nullable => 1 },
		"cid",
		{ data_type => "integer", is_nullable => 1 },
		"created",
                { data_type => 'datetime', timezone => "Asia/Shanghai", set_on_create => 1 },
                "updated",
                { data_type => 'datetime', timezone => "Asia/Shanghai", set_on_create => 1, set_on_update => 1 }

);
__PACKAGE__->set_primary_key("id");


# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-03-28 04:13:18
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Zi8Eq+9DHn/LOe7ruwVvpw

__PACKAGE__->has_many(
"stores_category",
"grouplife::Schema::Result::StoresCategory",
{ "foreign.category_id" => "self.id" },
);

__PACKAGE__->has_many(
"tuan_category",
"grouplife::Schema::Result::TuanCategory",
{ "foreign.category_id" => "self.id" },
);

__PACKAGE__->has_many(
"leimu_category",
"grouplife::Schema::Result::LeimuCategory",
{ "foreign.category_id" => "self.id" },
);

__PACKAGE__->many_to_many(stores => 'stores_category', 'stores');
__PACKAGE__->many_to_many(tuan => 'tuan_category', 'tuan');
__PACKAGE__->many_to_many(leimu => 'leimu_category', 'leimu');


# You can replace this text with custom code or comments, and it will be preserved on regeneration
__PACKAGE__->meta->make_immutable;
1;
